﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CompetitionDetails.ascx.cs" Inherits="Share_CompetitionDetails" %>    
 <%@ Register Assembly="jQueryDatePicker" Namespace="Westwind.Web.Controls" TagPrefix="ww" %>
<div class="competition_box">
        <div class="menuTitle">Competitions Details</div>
         <div class="cleaner_with_height"></div>
            <asp:DataList ID="dtl_Competition" runat="server" 
            oneditcommand="dtl_Competition_EditCommand" Width="680px" 
            oncancelcommand="dtl_Competition_CancelCommand" 
            onupdatecommand="dtl_Competition_UpdateCommand" ondeletecommand="dtl_Competition_DeleteCommand">
                 <ItemTemplate>
            <img src="../<%#Eval("Url")%>" alt="" width="100px" height="150px" />
            <div class="competition_info">
             <div class="left_title1">Topic:</div>  <div class="right_item1"><%#Eval("CompetitionName")%></div>
            <div class="cleaner"></div>
            <div class="left_title1">Details:</div> <div class="right_item1"><%#Eval("Details") %></div><br />
             <div class="left_title1">Condition:</div></h1>  <div class="right_item1"><%#Eval("Conditions") %></div><br />
           <div class="left_title1">Start Date:</div></h1> <div class="right_item1"><%#Eval("StartDate", "{0:MMMM d, yyyy}")%></div><br />
          
           <div class="left_title1">End Date:</div></h1>   <div class="right_item1"><%#Eval("EndDate", "{0:MMMM d, yyyy}")%></div><br />
          <div class="left_title1">Awards:</div> </h1>
          <asp:DataList ID="dtl_Awards" runat="server">
          <ItemTemplate>            
             <div class="left_title2"> <%#Eval("AwardName") %>: </div><div class="right_item2"> $ <%#Eval("Prize") %></div>
          </ItemTemplate>
            </asp:DataList>    
        </div>        
        <div class="cleaner">&nbsp;</div>

        <asp:LinkButton CommandName="Edit" ID="LinkButton4" Text="Update Information" runat="server"></asp:LinkButton> |
        <asp:LinkButton CommandName="Delete" ID="lbtnDelete" OnClientClick="javascript:return confirmAction();" Text="Delete" runat="server"></asp:LinkButton> | 
        <asp:LinkButton ID="lnkCancel" OnClick="Cancel_Button" Text="Cancel" runat="server"></asp:LinkButton>
        </ItemTemplate>

        <EditItemTemplate>
                <div id = "updateCompetion">                    
                    <h1>Competition Name</h1>
                    <p><asp:TextBox ID="txtCompetitionName" Text='<%#Eval("CompetitionName")%>' runat="server" Width="420px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
         ControlToValidate="txtCompetitionName" EnableTheming="True" 
         ErrorMessage="*Required!" ForeColor="Red" 
         ValidationGroup="1"></asp:RequiredFieldValidator></p>                    
                 <br />     <h1>Details</h1>
                    <p><asp:TextBox ID="txtDetails" Text='<%#Eval("Details")%>' runat="server" TextMode="MultiLine" Height="80px" Width="420px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
         ControlToValidate="txtDetails" EnableTheming="True" 
         ErrorMessage="*Required!" ForeColor="Red" 
         ValidationGroup="1"></asp:RequiredFieldValidator>
                    </p>
                    <br />    <h1>Condition</h1>
                    <p><asp:TextBox ID="txtCondition" Text='<%#Eval("Conditions")%>' runat="server" Width="420px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
         ControlToValidate="txtCondition" EnableTheming="True" 
         ErrorMessage="*Required!" ForeColor="Red" 
         ValidationGroup="1"></asp:RequiredFieldValidator>
                    </p>
                   <br />   <p><h1>Start Date</h1> <span>
                     <ww:jQueryDatePicker runat="server"
                id="txtStartDate" Text='<%#Eval("StartDate","{0:MM/dd/yyyy}")%>'   DisplayMode="AutoPopup" DateFormat="MM/dd/yyyy"  ></ww:jQueryDatePicker>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
         ControlToValidate="txtStartDate"  EnableTheming="True" 
         ErrorMessage="*Required!" ForeColor="Red" 
         ValidationGroup="1"></asp:RequiredFieldValidator>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
               ControlToValidate="txtStartDate" ErrorMessage="*Must Be DateTime!" 
               ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9]{2}" 
               ValidationGroup="1" ForeColor="Red"></asp:RegularExpressionValidator>
                  <%--
                    <asp:Label ID="lblDateSent" runat="server" Text="Posted on:" CssClass="graytextbold"></asp:Label>
                    <input ID="PostedOn" runat="server" class="NormalTextBox" readonly="readOnly" type="text" />&nbsp;
                    <a onkeydown="showCalendarControl('PostedOn')" href="#"><img src="../Images/calendar.gif" style="width: 20px; height: 20px" border="0" /></a>
                    --%>
                    </span>
                    </p>
                    <br />  <p>  <h1>End Date</h1> <span>
                     <ww:jQueryDatePicker runat="server"
                id="txtEndDate" Text='<%#Eval("EndDate","{0:MM/dd/yyyy}")%>'   DisplayMode="AutoPopup" DateFormat="MM/dd/yyyy"  ></ww:jQueryDatePicker>   
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
         ControlToValidate="txtEndDate" EnableTheming="True" 
         ErrorMessage="*Required!" ForeColor="Red" 
         ValidationGroup="1"></asp:RequiredFieldValidator>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
               ControlToValidate="txtEndDate" ErrorMessage="*Must Be DateTime!" 
               ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9]{2}" 
               ValidationGroup="1" ForeColor="Red"></asp:RegularExpressionValidator>
                    </span> </p>

                    <%-- <span><asp:LinkButton ID="LinkButton5"  Text='<%#Eval("StartDate","{0:dd/MM/yyyy})%>' runat="server">show Calendear</asp:LinkButton></span> --%>
                    <br />  
          <h1>Painting:</h1>  <asp:FileUpload ID="fuPainting" runat="server" Width="300px" /> 

                    <br />  <br />
                    </p>
                      <h1>Award</h1>
                    <p> <asp:DataList ID="dtl_Awards" runat="server">
                        <ItemTemplate>
                        <asp:Label ID="lblAwardID" runat="server" Text='<%#Eval("AwardID")%>' Visible="false"></asp:Label>

                            <span style="float: left; width: 30px;"><asp:Label ID="txtAwardName"  runat="server" Text='<%# Eval("AwardName") %> ' Font-Bold="True"></asp:Label> </span>
                    
                            <span  style="padding-left:0px; float: left;"> <asp:TextBox ID="txtPrice" Text='<%#Eval("Prize")%>' runat="server" Width="100px"></asp:TextBox></span>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
         ControlToValidate="txtPrice" EnableTheming="True" 
         ErrorMessage="*Required!" ForeColor="Red" 
         ValidationGroup="1"></asp:RequiredFieldValidator>
                             </p>                            
                        </ItemTemplate>
                     </asp:DataList>  
                     </p>
                     <p>
                    <asp:Button CommandName="Update" ID="btnUpdate" ValidationGroup="1" Text="Update" runat="server"></asp:Button>
                    <asp:Button CommandName="Cancel" ID="btnCancel" Text="Cancel" runat="server"></asp:Button>                    
                    </p>
               </div>
           </EditItemTemplate>

        </asp:DataList>
         <asp:Label ID="lblMessage" runat="server"></asp:Label>
      </div>
     
      <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
      <div class="cleaner_with_height">&nbsp;</div>      
